﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LCA.Community.DAL.Model;

namespace LCA.Community.DAL.Test.ModelFactories
{
    public class QuestionsFactory
    {
        int _count = 0;

        public QuestionsFactory()
        {

        }

        public Question CreateEntity(string author)
        {
            var question = new Question(
                                String.Format("Question {0}", _count),
                                author,
                                String.Format("This is the body of the question {0}", _count),
                                DateTime.Now
                            );
            question.RowKey = String.Format("test.{0}", Guid.NewGuid());

            _count++;
            return question;
        }

        public List<Question> CreateList(int count, string author)
        {
            var questions = new List<Question>();

            for (int i = 0; i < count; i++)
            {
                questions.Add(CreateEntity(author));
                ++_count;
            }

            return questions;
        }
    }
}
